<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 1字面量创建正则  //
      let hd = "houdunren.com";
      console.log(/u/.test(hd));
      //   2.对象创建
      let reg = new RegExp("u");
      console.log(reg.test());
    </script>
  </body>
</html>
